package com.study.edoc.exception;

/**
 * 自定义枚举类
 */
public enum ResultCodeEnum implements BaseErrorInfo {

    SUCCESS(200,"请求成功"),
    SERVER_ERROR(500,"服务器繁忙，请稍后重试"),
    NOT_FOUND(404,"请求资源未找到"),
    UNAUTHORIZED(401, "未经过认证的错误"),
    FORBIDDEN(403, "禁止访问错误"),
    UNKNOW_ERROR(-1001, "未知错误，请联系管理员"),
    PARAMETER_ERROR(-1000, "请求参数错误"),
    ;
    private int code;
    private String msg;

    ResultCodeEnum(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }
}
